package com.xzq.erp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.xzq.erp.domain.po.SysUserRole;
import com.xzq.erp.domain.vo.UserRoleVO;
import com.xzq.erp.mapper.SysUserRoleMapper;
import com.xzq.erp.service.ISysUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户与角色关联表 服务实现类
 * </p>
 *
 * @author xzq
 * @since 2025-05-19
 */
@Service
public class SysUserRoleServiceImpl extends ServiceImpl<SysUserRoleMapper, SysUserRole> implements ISysUserRoleService {

    @Override
    public List<UserRoleVO> getUserRoleVOList(List<Integer> userIds) {
        return this.baseMapper.getUserRoleVOList(userIds);
    }

    @Override
    public void removeByUserId(Long userId) {
        remove(new LambdaQueryWrapper<SysUserRole>().eq(SysUserRole::getUserId, userId));
    }
}
